﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Batman.Jianbei.Forum.Migrations.ChatRoomDb
{
    public partial class _201906241 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "MaskAlbum",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    Name = table.Column<string>(nullable: true),
                    Enabled = table.Column<bool>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MaskAlbum", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Mask",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    Avatar = table.Column<string>(nullable: true),
                    Nickname = table.Column<string>(nullable: true),
                    IsDeleted = table.Column<string>(nullable: true),
                    AlbumId = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Mask", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Mask_MaskAlbum_AlbumId",
                        column: x => x.AlbumId,
                        principalTable: "MaskAlbum",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateIndex(
                name: "IX_Mask_AlbumId",
                table: "Mask",
                column: "AlbumId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Mask");

            migrationBuilder.DropTable(
                name: "MaskAlbum");
        }
    }
}
